//重写move函数，使得地图容器操作与旋转匹配。
L.Draggable.include({
	_rotate: 0,
	_onMove: function(e) {
		if(!e._simulated || this._enabled)
			if(e.touches && 1 < e.touches.length) this._moved = !0;
			else{
				var first = (e.touches && e.touches.length === 1 ? e.touches[0] : e);
				var offset = new L.Point(first.clientX, first.clientY)._subtract(this._startPoint);
	 			if((!offset.x && !offset.y)&&(Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance)){
	 				return;
	 			}
				var x = offset.x / this._parentScale.x;
				var y = offset.y / this._parentScale.y;
				// 在offset时引入角度变量
				var rad = Math.PI*this._rotate / 180;
				offset.x = Math.cos(rad) * x + Math.sin(rad) * y;
				offset.y = Math.cos(rad) * y - Math.sin(rad) * x;
				L.DomEvent.preventDefault(e);
				if(!this._moved) {
					this.fire('dragstart');
					this._moved = true;
					this._startPos = L.DomUtil.getPosition(this._element).subtract(offset);
					L.DomUtil.addClass(document.body, 'leaflet-dragging');
					this._lastTarget = e.target || e.srcElement;
					if((window.SVGElementInstance) && (this._lastTarget instanceof window.SVGElementInstance)) {
						this._lastTarget = this._lastTarget.correspondingUseElement;
					}
					L.DomUtil.addClass(this._lastTarget, 'leaflet-drag-target');
				}

				this._newPos = this._startPos.add(offset);
				this._moving = true;

				L.Util.cancelAnimFrame(this._animRequest);
				this._lastEvent = e;
				this._animRequest = L.Util.requestAnimFrame(this._updatePosition, this, true);
			}
	},
	setRotate: function(rotate) {
		this._rotate = rotate;
	},
});
